<template>
  <div>子组件
    <br>
  <p>我是父组件的值 {{data}}</p>
  <br>
子传父值
<br>
 <button @click="childData">传值</button>
  </div>


</template>

<script>

export default {
  name:'son',
  props:{
    data:String
  },
  data(){
return{
  childValue:'父亲好！',

}
  },
  
  methods:{
  childData(){
    console.log('传值成功');
    this.$emit('childValue',this.childValue)
  },

  
  }

}
</script>

<style>

</style>